<%@ page import="java.sql.*" %>
<%!
Driver driver=null;
String driverUsed="oracle.jdbc.driver.OracleDriver";
String serverAddress="jdbc:oracle:thin:@172.16.60.13:1521:orcl";
String username="A152786";
String password="152786";

public Connection getConnected() throws Exception{
Connection conn = null;
try {
if (driver==null)
driver = (Driver)Class.forName(driverUsed).newInstance();
conn = DriverManager.getConnection(serverAddress, username, password);
return conn;
}

catch (Exception e){
throw new Exception("Database Gagal Dihubungkan");
}
}
%>